// Package model
// @Author zhongxc
// @Date 2024/7/19 14:46:00
// @Desc
package model

import (
	"database/sql"
)

type RoleQueryModel struct {
	Id        int64        `gorm:"column:id;primary_key" form:"id" json:"id"`
	Name      string       `gorm:"column:name" json:"name" form:"name"`
	Code      string       `gorm:"column:code" json:"code" form:"code"`
	OrderNo   int64        `gorm:"column:order_no" json:"order_no" form:"order_no"`
	Remark    string       `gorm:"column:remark" json:"remark" form:"remark"`
	Status    int32        `gorm:"column:status" json:"status" form:"status"`
	CreatedBy string       `gorm:"column:created_by" json:"created_by" form:"created_by"`
	CreatedAt sql.NullTime `gorm:"column:created_at" json:"created_at" form:"created_at"`
	UpdatedBy string       `gorm:"column:updated_by" json:"updated_by" form:"updated_by"`
	UpdatedAt sql.NullTime `gorm:"column:updated_at" json:"updated_at" form:"updated_at"`
	Deleted   int8         `gorm:"column:deleted" json:"deleted" form:"deleted"`
	DeletedBy string       `gorm:"column:deleted_by" json:"deleted_by" form:"deleted_by"`
	DeletedAt sql.NullTime `gorm:"column:deleted_at" json:"deleted_at" form:"deleted_at"`
	Menu      string       `gorm:"column:menu" json:"menu" form:"menu"`
}

type RoleModel struct {
	Id        int64        `gorm:"column:id;primary_key" form:"id" json:"id"`
	Name      string       `gorm:"column:name" json:"name" form:"name"`
	Code      string       `gorm:"column:code" json:"code" form:"code"`
	OrderNo   int64        `gorm:"column:order_no" json:"order_no" form:"order_no"`
	Remark    string       `gorm:"column:remark" json:"remark" form:"remark"`
	Status    int32        `gorm:"column:status" json:"status" form:"status"`
	CreatedBy string       `gorm:"column:created_by" json:"created_by" form:"created_by"`
	CreatedAt sql.NullTime `gorm:"column:created_at" json:"created_at" form:"created_at"`
	UpdatedBy string       `gorm:"column:updated_by" json:"updated_by" form:"updated_by"`
	UpdatedAt sql.NullTime `gorm:"column:updated_at" json:"updated_at" form:"updated_at"`
	Deleted   int8         `gorm:"column:deleted" json:"deleted" form:"deleted"`
	DeletedBy string       `gorm:"column:deleted_by" json:"deleted_by" form:"deleted_by"`
	DeletedAt sql.NullTime `gorm:"column:deleted_at" json:"deleted_at" form:"deleted_at"`
	Menu      string       `gorm:"column:menu" json:"menu" form:"menu"`
}

func NewRoleModel() *RoleModel {
	return &RoleModel{}
}

func (r *RoleModel) TableName() string {
	return "sys_role"
}

func (r *RoleQueryModel) TableName() string {
	return "sys_role"
}
